﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once


#include "IEvent.h"
#include "GcmpModelInterface.h"

namespace gcmp
{
    class INotificationEventHandler;
    class INotificationEventArgs;
    class INotificationManager;

    /// \brief 弱提示事件接口类
    ///
    /// 提供了添加、删除事件处理者，获取事件发送者的接口
    class GCMP_MODEL_INTERFACE_EXPORT INotificationEvent : public IEvent
    {
        DEFINE_CAST_DERIVED(gcmp::INotificationEvent, gcmp::IEvent);
    public:

        /// \brief 添加弱提示事件处理者
        /// \param pHandler   弱提示事件处理者
        /// \return 添加成功返回true，否则返回false
        virtual bool Add(INotificationEventHandler* pHandler) = 0;

        /// \brief 删除弱提示事件处理者
        /// \param pHandler   弱提示事件处理者
        /// \return 删除成功返回true，否则返回false
        virtual bool Delete(INotificationEventHandler* pHandler) = 0;

        /// \brief 获取弱提示事件发送者
        /// \return 返回弱提示事件管理器
        virtual INotificationManager* GetSender() const = 0;
    };
}


